<?php

if ( ! defined("IN_OP") )
{
    exit("You can't access this file directly...");
}
$tabs_menu_list = "";
$tab_container_list = "";
$show_onLine_num_flag = true;
include_once( "class/function_3d.php" );

if ( $g_init_mode_6h )
{
    $tabs_menu_list .= "<li {$g_only_6h}><a href=\"#tab0\" class=\"tabcolor0\">六合彩</a></li>";
    $tab_container_list .= "<div id=\"tab0\" class=\"tab_content\">".( "<div class=\"menuLv02\">" ).posToMenu("结果" , "?op=agent&fp=result" , "mainFrame" , "resu").posToMenu("规则" , "?op=agent&fp=rule" , "mainFrame" , "rule").posToMenu("参考" , "?op=core&fp=lotto_open" , "mainFrame" , "lotto_open").posToMenu("登出" , "?op=core&fp=logout" , "_top" , "logo")."</div>";
    if ( $curruser['prev_id'] == 0 )
    {
        $tab_container_list .= "<div class=\"menuLv03\">".posToMenu("即时注单" , "?op=agent&fp=onlinebet" , "mainFrame" , "onli").posToMenu("操盘" , "?op=admin&fp=now1" , "mainFrame" , "now").posToMenu("走飞" , "?op=admin&fp=unow1" , "mainFrame" , "unow").posToMenu("帐号管理" , "?op=agent&fp=acctreeidx&gametype=0" , "mainFrame" , "acctreeidx").posToMenu("公司" , "?op=admin&fp=subaccount&gametype=0" , "mainFrame" , "suba");
        $tab_container_list .= posToMenu("报表" , "?op=agent&fp=paper_all" , "mainFrame" , "pape").posToMenu("警示" , "?op=admin&fp=alert" , "mainFrame" , "aler").posToMenu("开奖" , "?op=admin&fp=history" , "mainFrame" , "hist").posToMenu("系统" , "?op=admin&fp=admin" , "mainFrame" , "admi")."</div>";
    }
    else
    {
        $tab_container_list .= "<div class=\"menuLv03\">";
        $rs = getdb("select id from k_user where acl=5 and supe_account='".$curruser['account']."' LIMIT 1");
        if ( ! $rs->eof )
        {
            $show_onLine_num_flag = false;
            $tab_container_list .= posToMenu("报表" , "?op=agent&fp=paper_all" , "mainFrame" , "pape1").posToMenu("设置" , "?op=agent&fp=subinfo" , "mainFrame" , "subi");
        }
        else
        {
            $subAccRight_Arr = array ( 0 , 0 , 0 , 0 , 0 );
            if ( $curruser['supe_account'] == "'" || $curruser['supe_account'] == "" )
            {
                $subAccRight_Arr[0] = $curruser['detailed_list'];
                $subAccRight_Arr[2] = $curruser['manage_power'];
            }
            else if ( strlen($curruser['supe_account']) == 5 )
            {
                $subAccRight_Arr = str_split($curruser['supe_account']);
            }
            $sysMenu = $subAccRight_Arr[4] == 2?"admin":"admin1";
            $tab_container_list .= ( $subAccRight_Arr[0]?posToMenu("即时注单" , "?op=agent&fp=onlinebet" , "mainFrame" , "onli"):"" ).( $subAccRight_Arr[1]?posToMenu("操盘" , "?op=admin&fp=now1" , "mainFrame" , "now"):"" ).( $subAccRight_Arr[1]?posToMenu("走飞" , "?op=admin&fp=unow1" , "mainFrame" , "unow"):"" ).( $subAccRight_Arr[2]?posToMenu("帐号管理" , "?op=agent&fp=acctreeidx&gametype=0" , "mainFrame" , "acctreeidx"):"" ).( $subAccRight_Arr[0]?posToMenu("报表" , "?op=agent&fp=paper_all" , "mainFrame" , "pape"):"" ).( $subAccRight_Arr[3]?posToMenu("开奖" , "?op=admin&fp=history" , "mainFrame" , "hist"):"" ).posToMenu("设置" , "?op=agent&fp=subinfo" , "mainFrame" , "subi").( $subAccRight_Arr[4]?posToMenu("系统" , "?op=admin&fp={$sysMenu}" , "mainFrame" , "admi1"):"" );
        }
        $rs->close();
        $tab_container_list .= "</div>";
    }
    $tab_container_list .= "</div>";
}
if ( $g_init_mode_3d )
{
    foreach ( $g_gametype_3d as $i => $val )
    {
        $tabs_menu_list .= $i && $g_menu_enabled[$i] == 1?$g_menu_list[$i]:"";
    }
    if ( $curruser['prev_id'] == 0 )
    {
        foreach ( $g_gametype_3d as $i => $val )
        {
            if ( $g_menu_enabled[$i] == 0 || ! $i )
            {
                continue;
            }
            $pg = $g_gametype_3d[$i]['pg'];
            $tab_container_list .= "<div id=\"tab{$i}\" class=\"tab_content\">"."<div class=\"menuLv02\">".posToMenu("即时注单" , "?op=agent&fp=onlinebet{$pg}&gametype={$i}" , "mainFrame" , "onli").posToMenu("操盘" , "?op=admin&fp=now_3d&gametype={$i}" , "mainFrame" , "now").posToMenu("走飞" , "?op=admin&fp=unow_3d&gametype={$i}" , "mainFrame" , "unow").posToMenu("帐号管理" , "?op=agent&fp=acctreeidx&gametype={$i}" , "mainFrame" , "acctreeidx").posToMenu("公司" , "?op=admin&fp=subaccount&gametype={$i}" , "mainFrame" , "suba");
            $tab_container_list .= posToMenu("报表" , "?op=agent&fp=paper_all&gametype={$i}" , "mainFrame" , "pape").posToMenu("警示" , "?op=admin&fp=alert_3d&gametype={$i}" , "mainFrame" , "aler").posToMenu("开奖" , "?op=admin&fp=history_3d&gametype={$i}" , "mainFrame" , "hist").posToMenu("系统" , "?op=admin&fp=admin{$pg}&gametype={$i}" , "mainFrame" , "admi").posToMenu("结果" , "?op=agent&fp=result{$pg}&gametype={$i}" , "mainFrame" , "resu").posToMenu("规则" , "?op=agent&fp=rule_3d&gametype={$i}" , "mainFrame" , "rule").posToMenu("参考" , "?op=core&fp=lotto_open" , "mainFrame" , "lotto_open").posToMenu("登出" , "?op=core&fp=logout" , "_top" , "logo")."</div>"."</div>";
        }
    }
    else
    {
        $rs = getdb("select id from k_user where acl=5 and supe_account='".$curruser['account']."'");
        if ( ! $rs->eof )
        {
            $show_onLine_num_flag = false;
            foreach ( $g_gametype_3d as $i => $val )
            {
                if ( $g_menu_enabled[$i] == 0 || ! $i )
                {
                    continue;
                }
                $pg = $g_gametype_3d[$i]['pg'];
                $tab_container_list .= "<div id=\"tab{$i}\" class=\"tab_content\">"."<div class=\"menuLv02\">".posToMenu("报表" , "?op=agent&fp=paper_all&gametype={$i}" , "mainFrame" , "pape1").posToMenu("设置" , "?op=agent&fp=subinfo&gametype={$i}" , "mainFrame" , "subi").posToMenu("结果" , "?op=agent&fp=result{$pg}&gametype={$i}" , "mainFrame" , "resu").posToMenu("规则" , "?op=agent&fp=rule_3d&gametype={$i}" , "mainFrame" , "rule").posToMenu("登出" , "?op=core&fp=logout" , "_top" , "logo")."</div>"."</div>";
            }
        }
        else
        {
            $subAccRight_Arr = array ( 0 , 0 , 0 , 0 , 0 );
            if ( $curruser['supe_account'] == "'" || $curruser['supe_account'] == "" )
            {
                $subAccRight_Arr[0] = $curruser['detailed_list'];
                $subAccRight_Arr[2] = $curruser['manage_power'];
            }
            else if ( strlen($curruser['supe_account']) == 5 )
            {
                $subAccRight_Arr = str_split($curruser['supe_account']);
            }
            foreach ( $g_gametype_3d as $i => $val )
            {
                if ( $g_menu_enabled[$i] == 0 || ! $i )
                {
                    continue;
                }
                $pg = $g_gametype_3d[$i]['pg'];
                $sysMenu = $subAccRight_Arr[4] == 2?"admin{$pg}":"admin1_3d";
                $tab_container_list .= "<div id=\"tab{$i}\" class=\"tab_content\">"."<div class=\"menuLv02\">".( $subAccRight_Arr[0]?posToMenu("即时注单" , "?op=agent&fp=onlinebet{$pg}&gametype={$i}" , "mainFrame" , "onli"):"" ).( $subAccRight_Arr[1]?posToMenu("操盘" , "?op=admin&fp=now_3d&gametype={$i}" , "mainFrame" , "now"):"" ).( $subAccRight_Arr[1]?posToMenu("走飞" , "?op=admin&fp=unow_3d&gametype={$i}" , "mainFrame" , "unow"):"" ).( $subAccRight_Arr[2]?posToMenu("帐号管理" , "?op=agent&fp=acctreeidx&gametype={$i}" , "mainFrame" , "acctreeidx"):"" ).( $subAccRight_Arr[0]?posToMenu("报表" , "?op=agent&fp=paper_all&gametype={$i}" , "mainFrame" , "pape"):"" ).( $subAccRight_Arr[3]?posToMenu("开奖" , "?op=admin&fp=history_3d&gametype={$i}" , "mainFrame" , "hist"):"" ).posToMenu("设置" , "?op=agent&fp=subinfo&gametype={$i}" , "mainFrame" , "subi").( $subAccRight_Arr[4]?posToMenu("系统" , "?op=admin&fp={$sysMenu}&gametype={$i}" , "mainFrame" , "admi1"):"" ).posToMenu("结果" , "?op=agent&fp=result{$pg}&gametype={$i}" , "mainFrame" , "resu").posToMenu("规则" , "?op=agent&fp=rule_3d&gametype={$i}" , "mainFrame" , "rule").posToMenu("登出" , "?op=core&fp=logout" , "_top" , "logo")."</div>"."</div>";
            }
        }
        $rs->close();
    }
}
$tmpArr = array ( );
foreach ( $g_gametype_3d as $gameid => $val )
{
    $tmpArr[] = QuotedStr("op.php?op=admin&fp=login".( 0 < $gameid?"_3d":"" )."&gametype={$gameid}");
}
$linkArr = implode("," , $tmpArr);
$ui->set(array ( "tabs_menu_list" => $tabs_menu_list,"time"=>time(), "tab_container_list" => $tab_container_list , "linkArr" => $linkArr , "myInfo" => "【hi, ".$aclname[$curruser['acl']]." ".$curruser['account']."】 " , "showOnLineNum" => $show_onLine_num_flag?"<span class=\"onlineNum\"><b id=\"myOnlineNum\">线上人数</b>:&nbsp;<b class=\"onlineNum2\">0</b>&nbsp;</span>":"" , "showNolineNumJS" => $show_onLine_num_flag?"myTimeRenewONum();":"" ));